# Ruben 参照TCP控制 RFC793协议 transport control protocol
# 参照 https://www.freebuf.com/sectool/94507.html
# 让神经防火墙不发RST包 sudo iptables -A OUTPUT -p tcp --tcp-flags RST RST -d 180.101.49.11 -j DROP


import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *


dst_ip="180.101.49.11"
src_port=5555
dst_port=80

scan_packet=IP(dst=dst_ip)/TCP(dport=dst_port,sport=src_port,flags="S")
tcp_scan_resp=sr1(scan_packet,timeout=1)

send_rest=sr1(IP(dst=dst_ip)/TCP(dport=dst_port,sport=src_port,seq=tcp_scan_resp.ack,ack=tcp_scan_resp.seq+1,flags="A"),timeout=1)
